import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

public class Test {

    public static void main(String[] args) {
        /*Queue<BinaryTree.TreeNode> queue = new LinkedList<>();
        queue.offer(null);
        queue.offer(null);
        queue.offer(null);
        System.out.println(queue.size());*/

        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("============前序遍历==========");
        binaryTree.preOrderNor(root);
        System.out.println();
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("============中序遍历==========");
        binaryTree.inOrderNor(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        System.out.println("==========后序遍历============");
        binaryTree.postOrderNor(root);
        System.out.println();
        binaryTree.postOrder(root);
    }

    public static void main2(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();

        binaryTree.levelOrder(root);
    }

    public static void main1(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();

        binaryTree.preOrder(root);
        System.out.println();
        List<Character> preList = binaryTree.preorderTraversal2(root);
        System.out.println(preList);
        System.out.println();

        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("===节点个数：===");
        binaryTree.size(root);
        System.out.println(binaryTree.nodeSize);
        System.out.println("===节点个数2：===");
        System.out.println(binaryTree.size2(root));
        System.out.println("===叶子节点个数：===");
        binaryTree.getLeafNodeCount(root);
        System.out.println(binaryTree.leafSize);
        System.out.println("第K层的节点个数：");
        System.out.println(binaryTree.getKLevelNodeCount(root,4));
        System.out.println("======高度：=======");
        System.out.println(binaryTree.getHeight2(root));
    }
}
